package com.iv.durian.cloud.api.service;

import com.iv.durian.cloud.Student;
import com.iv.durian.cloud.facade.StudentFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentService {

    @Autowired
    private StudentFacade studentFacade;

    public Student getStudentById(Integer studentId) { return studentFacade.get(studentId);}

    public void addStudent(Student student){
        studentFacade.add(student);
    }

    public void update(Student student) {studentFacade.update(student); }

    public int remove(Integer id) {return studentFacade.remove(id); }

    public int count(Integer id) {
        return studentFacade.count(id);
    }

    public List<Student> list(Integer id, int offset, int limit){
        return studentFacade.list(id,offset,limit);
    }
}
